package tcu.se.testing.mockito;

import java.util.List;
import java.util.stream.Collectors;

public class MovieLister {
    MovieFinder finder;
    public MovieLister(MovieFinder finder){

        this.finder = finder;
    }
    public List<String> movieNamesDirectedBy(String director){
        return  finder.findAll().stream()
                .filter(movie -> movie.DirectedBy(director))
                .map(Movie::getName)
                .collect(Collectors.toList());
    }
}